package semSimilarity.sentence;

import java.util.List;

import semSimilarity.SimilarityGenerator;
import semSimilarity.SimilarityMatrix;
import sentStruct.PartOfSpeech;

public class PartOfSpeechEqualitiy implements SimilarityGenerator<PartOfSpeech>{

	@Override
	public double similarity(PartOfSpeech el1, PartOfSpeech el2) {
		if (el1.getValue().equals(el2.getValue()))
			return 1;
		else return 0;
	}

	@Override
	public double similarity(List<? extends PartOfSpeech> list1,
			List<? extends PartOfSpeech> list2) {
		if (list1==null||list2==null||list1.size()==0||list2.size()==0)
			return 0;
		
		SimilarityMatrix<PartOfSpeech> simMatrix = new SimilarityMatrix<PartOfSpeech>(list1, list2, this);
		
	
	
		return simMatrix.maxSimilarityAverage();
	}

}
